# 关注点：
# 1  子类继承了基类的方法，无需任何操作得到了基类的方法（例10.6.1.py）
# 2  子类执行多态方法（例10.6.2.py）
# 3  构造一个调用基类方法的方法A，增加新子类，同样能使用该方法A(例10.6.3.py)

class people:
    def talk(self):
        print("大家好")

class  teacher(people):
    def talk(self):
        print("同学们好")

class student(people):
    def talk(self):
        print("老师好")

def startTalk(people):
    print("----准备发言---------")
    people.talk()
    print("-----发言结束------")

# lilizong=teacher()
# startTalk(lilizong)

# xiaoming=people()
# startTalk(xiaoming)

# xiaohua=student()
# startTalk(xiaohua)

class doctor(people):
    def talk(self):
        print("你怎么了？")

xiaohua=doctor()
startTalk(xiaohua)


# x=[234522,35,24,52,5,2,52,5,2]   # x是一个列表(list)
# y=(2345,2,5,25,23,52,5,25,25,8)   #y是一个元组（tuple)
# print(isinstance(x,list) )
# print(isinstance(y,tuple))
# lilizong=teacher()
# print(isinstance(lilizong,teacher))
# print(isinstance(lilizong,student))
# print(isinstance(lilizong,people))





class guaishou:
    def kill(self):
        print("我开始打人了")

class feishou(guaishou):
    def kill(self):
        print("飞行攻击！！加倍")
    # pass
class shuishou(guaishou):
    def kill(self):
        print("水下攻击！！加倍")

def startKill(guaishou):
    print("======攻击开始==========")
    guaishou.kill()
    print("======攻击结束===========")





# numberA=guaishou()
# numberB=feishou()
# numberC=shuishou()
# startKill(numberA)
# startKill(numberB)
# startKill(numberC)

# # 新定义类
# class xinshou(guaishou):
#     def kill(self):
#         print("新武器！！加倍")
#     # pass
# numberD=xinshou()
# startKill(numberD)



# a=[4,5,5,5]
# b=(5,6,76,7)
# print(isinstance(a,list))
# print(isinstance(b,tuple))
# print(isinstance(numberB,feishou))
# print(isinstance(numberB,guaishou))